package com.kaizeli.website.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * 考勤记录实体类
 */
@Data
@TableName("attendance")
public class AttendanceDO {
    
    @TableId(type = IdType.NONE)
    private Long id;
    
    /**
     * 员工ID
     */
    @TableField("employee_id")
    private Long employeeId;
    
    /**
     * 员工姓名
     */
    @TableField("employee_name")
    private String employeeName;
    
    /**
     * 员工编号
     */
    @TableField("employee_code")
    private String employeeCode;
    
    /**
     * 项目ID
     */
    @TableField("project_id")
    private Long projectId;
    
    /**
     * 项目编号
     */
    @TableField("project_code")
    private String projectCode;
    
    /**
     * 项目名称
     */
    @TableField("project_name")
    private String projectName;
    
    /**
     * 考勤日期
     */
    @TableField("attendance_date")
    private LocalDate attendanceDate;
    
    /**
     * 签到时间
     */
    @TableField("check_in_time")
    private LocalTime checkInTime;
    
    /**
     * 签退时间
     */
    @TableField("check_out_time")
    private LocalTime checkOutTime;
    
    /**
     * 实际工作时长（小时）
     */
    @TableField("work_hours")
    private BigDecimal workHours;
    
    /**
     * 考勤状态（normal-正常，late-迟到，early_leave-早退，absent-缺勤，overtime-加班，leave-请假）
     */
    @TableField("attendance_status")
    private String attendanceStatus;
    
    /**
     * 请假类型（sick_leave-病假，personal_leave-事假，annual_leave-年假，compensatory_leave-调休）
     */
    @TableField("leave_type")
    private String leaveType;
    
    /**
     * 加班时长（小时）
     */
    @TableField("overtime_hours")
    private BigDecimal overtimeHours;
    
    /**
     * 备注
     */
    @TableField("remark")
    private String remark;
    
    /**
     * 审核状态（pending-待审核，approved-已通过，rejected-已拒绝）
     */
    @TableField("status")
    private String status;
    
    /**
     * 审核人ID
     */
    @TableField("approver_id")
    private Long approverId;
    
    /**
     * 审核人姓名
     */
    @TableField("approver_name")
    private String approverName;
    
    /**
     * 审核时间
     */
    @TableField(value = "approval_time", jdbcType = JdbcType.TIMESTAMP)
    private LocalDateTime approvalTime;
    
    /**
     * 审核备注
     */
    @TableField("approval_remark")
    private String approvalRemark;
    
    /**
     * 创建时间
     */
    @TableField(value = "create_time", jdbcType = JdbcType.TIMESTAMP)
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @TableField(value = "update_time", jdbcType = JdbcType.TIMESTAMP)
    private LocalDateTime updateTime;
    
    /**
     * 创建人ID
     */
    @TableField("created_by")
    private Long createdBy;
}

